
import {colorType} from "./HeroControl";
import GameData_red_blue_man from "./GameData_red_blue_man";

const {ccclass, property} = cc._decorator;

@ccclass
export default class ChangeSkin extends cc.Component {

    @property({tooltip: "人物颜色", type: cc.Enum(colorType)})
    manType: colorType = colorType.red;

    // onLoad () {}

    start () {
        this.change();
    }

    change(){
        if(this.manType == colorType.red){
            this.node.getComponent(sp.Skeleton).setSkin("red" + GameData_red_blue_man.usingSkinIndex);
        }else if(this.manType == colorType.blue){
            this.node.getComponent(sp.Skeleton).setSkin("blue" + GameData_red_blue_man.usingSkinIndex);
        }
    }

    // update (dt) {}
}
